from PySide6.QtCore import (Qt,QObject,QMetaObject,
                            Signal,Slot,
                            QThread,QThreadPool,QTimer,
                            QTemporaryFile,QTemporaryDir,
                            QJsonArray,QJsonDocument,QJsonParseError,QJsonValue,
                            QFile,QFileDevice,QIODevice,QIODeviceBase)






from selenium.webdriver.edge.webdriver import WebDriver
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.options import Options
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import *



# # 定义变量
# # 加载驱动远程链接调试浏览器    
# options = Options()
# service = Service()
# options.add_experimental_option("debuggerAddress", f"{host}:{port}")
# driver = WebDriver(options=options)
# actions = ActionChains(driver=driver)
# wait = WebDriverWait(driver=driver,timeout=10)
# # driver.implicitly_wait(10)  # 隐式等待，当页面元素不存在时，等待10秒，如果存在就继续执行
# signal_args = {
#     "driver":driver,
#     "actions":actions,
#     "wait":wait,
#     "args":""
# }

class Qt_Custom_Staff_Class(QObject):
    Start_Task = Signal()
    Task_Finsh = Signal()
    Current_Completion_Process = Signal(int)
    Emergency_Stop = Signal()
    OnlyRun = Signal()
        
    def __init__(self, parent=None):
        super().__init__(parent)
        self.Start_Task.connect(self.RunTask)
        
    @Slot(str)
    def solt_fun(self,text):
        print(f"我是槽函数,我是 {text}")

    # 设置员工属性
    def Set_Staff_Attribute(self,**kwargs):
        pass

    def RunTask(self):
        pass